package main

import (
	"github.com/gin-gonic/gin"
	. "liteblog/src/handler"
	"net/http"
)

func main() {
	router := gin.Default()
	router.Static("/static", "./static")
	router.LoadHTMLGlob("templates/*")
	router.GET("/msg", func(c *gin.Context) {
		obj := gin.H{"title": "留言板"}
		c.HTML(http.StatusOK, "index.html", obj)
	})
	msg := router.Group("/msg")
	{
		msg.GET("page/:pageid", GetMsgPage)
		msg.POST("put", InsertMsg)
	}
	router.Run(":8090")
}
